package main
import(
	"fmt"
)

func main(){
	n1 := 10
	// 调用test(n1)
	test(n1)
	fmt.Println("main() n1=",n1)  // 
	
	sum := getSum(10,20)
	fmt.Println("main sum =",sum)

	res1, res2 := getSumAndSub(1,2)
	fmt.Println("res1=%v res2=%v \n",res1,res2)

	// 希望忽略某个返回值，则使用 —— 符号表示占位忽略
	_, res3 := getSumAndSub(1,2)
	fmt.Printf("res3=%v \n",res3)
	
}

func getSumAndSub(n1 int, n2 int) (int, int){
	sum := n1 + n2
	sub := n1 - n2
	return sum, sub
}

func test(n1 int){
	n1  += 1
	fmt.Println("test() n1 = ",n1)
}

func getSum(n1 int, n2 int) int {
	sum := n1 + n2
	fmt.Println("getSum() sum =",sum)
	return sum
}